local duoye = fk.CreateSkill{
  name = "hanqing__duoye",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["hanqing__duoye"] = "堕业",
  [":hanqing__duoye"] = "锁定技，当你死亡后，依次废除场上<a href=':hanqing__precept'>《戒律》</a>所在装备栏，"..
 " 然后本局游戏中有装备栏被废除的角色视为永久拥有对应<a href=':hanqing__precept'>《戒律》</a>，"..
  "当其触发<a href=':hanqing__precept'>《戒律》</a>时，其执行<a href='hanqing_reform'>革制</a>。",
}

duoye:addEffect(fk.Deathed, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(duoye.name, true, true)
  end,
  on_cost = function (self, event, target, player, data)
    event:setCostData(self, {tos = player.room:getAlivePlayers()})
    return true
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:setBanner(duoye.name, 1)
    for _, p in ipairs(room:getAlivePlayers()) do
      if not p.dead and #p:getCardIds("e") > 0 then
        local slots = {}
        for _, id in ipairs(p:getCardIds("e")) do
          local card = Fk:getCardById(id)
          if card.trueName == "precept" then
            table.insert(slots, Util.convertSubtypeAndEquipSlot(card.sub_type))
          end
        end
        if #slots > 0 then
          room:abortPlayerArea(p, slots)
        end
      end
    end
  end,
})

return duoye
